﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zeus.Thunder.Core;

namespace SharpTrainer.FileStreams
{
    class TextReaderWriterTest : ITestCase
    {
        public void Run()
        {
            using (TextWriter writer = File.CreateText ("text_test.txt"))
            {
                writer.WriteLine ("Line1");
                writer.WriteLine ("Line2");
            }

            using (TextWriter writer = File.AppendText("text_test.txt"))
                writer.WriteLine("很好");

            using (TextReader reader = File.OpenText("text_test.txt"))
            while (reader.Peek() > -1)
            Console.WriteLine (reader.ReadLine()); 
        }
    }
}
